package com.tsystems.skilltest;

import com.tsystems.skilltest.service.GetTransactionServicePublisher;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.jms.JMSException;
import javax.xml.bind.JAXBException;

/**
 * @author aesipov
 */
public class Application
{
    public static void main(String[] args) throws JMSException, JAXBException
    {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-skilltest.xml");

        GetTransactionServicePublisher getTransactionServicePublisher = (GetTransactionServicePublisher) context.getBean("servicePublisher");
        getTransactionServicePublisher.publishService();

        ReceiveAndProcessTransactionService receiveAndProcessService = (ReceiveAndProcessTransactionService) context.getBean("recieveAndProcess");
        receiveAndProcessService.start();
    }
}
